<?php
header("content-type:text/html; charset=utf-8");
$servername = "localhost";
$username = "root";
$password = "123";
$dbname = "test";
//mysql_query("set names 'utf8'");
// 创建连接
$conn = new mysqli($servername, $username, $password, $dbname);
// 检测连接	
if ($conn->connect_error) {
    die("连接失败: " . $conn->connect_error);
}
$goods_id=SELECT auto_increment FROM information_schema.`TABLES` WHERE TABLE_SCHEMA='test' AND TABLE_NAME='goods';
$arr=$_GET["goooods.emm"];
foreach($arr as $style => $price){
    $stmt = $conn->prepare("INSERT INTO style_price(goods_id,style,price) VALUES (?,?,?)");
    $stmt->bind_param("ssssddiss",$goods_id,$style,$price);
    $stmt->execute();
}

echo "新记录插入成功";
$stmt->close();
$conn->close();
?> 